/**
 * Created by tanbingqin on 2021/1/11.
 */
import { messages } from "share/common";
/**
 * 操作：详情
 * 适用：展示员工详情信息
 */
import React from "react";
import { connect } from "react-redux";
import menuRoute from "routes/menuRoute";
import { Form, Button, Modal, message } from "antd";
import EmployeeInfo from "containers/enterprise-manage/person-manage/person-info-display/employee-info";

class EmployeeInfoBtn extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      modalVisible: false,
    };
  }

  componentDidMount() {}

  showModal = () => {
    this.setState({ modalVisible: true });
  };

  render() {
    const { modalVisible } = this.state;
    const { info, creditScore } = this.props;
    return (
      <span>
        <span style={{ color: "#4b8dff", cursor: "pointer" }} onClick={this.showModal}>
          {messages("common.detail") /*详情*/}
        </span>
        <Modal
          visible={modalVisible}
          title={messages("common-1.key570") /*员工信息*/}
          className="slide-document-applicant-modal"
          width={760}
          footer={[
            <Button type="primary" onClick={this.toState({ modalVisible: false })}>
              {messages("common-1.key41") /*关闭*/}
            </Button>,
          ]}
          onCancel={this.toState({ modalVisible: false })}
        >
          <EmployeeInfo
            activeKey="position"
            params={{
              userOID: info && info.applicant && info.applicant.userOID,
              jobId: info && info.jobId,
            }}
          />
        </Modal>
      </span>
    );
  }
}

EmployeeInfoBtn.propTypes = {
  info: React.PropTypes.object,
  creditScore: React.PropTypes.object,
};

function mapStateToProps(state) {
  return {};
}

export default connect(mapStateToProps)(EmployeeInfoBtn);
